﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="cart_home.ascx.cs" Inherits="Views_module_cart_home"  %>

<div align=center style="color:#9400D3;font-size:30px;" align="center">
Giỏ Hàng
<div style="height:20px;"></div>
</div>

<div class="middle">
    <asp:datalist ID="dtlCartProducts" Width="100%" runat="server" 
      OnEditCommand="dtlCartProducts_EditCommand" DataKeyField="Product_id"
      OnCancelCommand="dtlCartProducts_CancelCommand"
      OnDeleteCommand="dtlCartProducts_DeleteCommand" 
      OnUpdateCommand="dtlCartProducts_UpdateCommand">
        <HeaderTemplate>
            <table class="cart" style="width: 100%;">
            <tr>
              <th align="center">Action</th>
              <th align="center">Ảnh</th>
              <th align="left">Tên</th>
              <th align="right">Số lượng</th>
              <th align="right">Giá</th>
              <th align="right">Tổng</th>
            </tr>
        </HeaderTemplate>
        <EditItemTemplate>
            <tr class="even">
              <td align="center"><asp:imagebutton AlternateText="Update" ImageUrl="~/image/update.gif" ID="UpdateLinkButton" CommandName="Update" Text="Cập nhật" runat="server" />&nbsp &nbsp<asp:imagebutton AlternateText="Cancel" ImageUrl="~/image/cancel.gif" ID="CancelLinkButton" CommandName="Cancel" Text="Hủy bỏ" runat="server" /></td>
              <td align="center"><asp:HyperLink  NavigateUrl='~/product.ascx?id=<%#Eval("Product_id") %>' runat="Server" ><asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("image") %>' Width="40px" Height="40px" AlternateText='<%# Eval("product_name") %>' /></asp:HyperLink></td>
              <td align="left" valign="top"><a href=""><%# DataBinder.Eval(Container.DataItem, "product_name") %></a></td>                
              <td align="right" valign="top"><asp:TextBox id='quantity2' Text='<%# Bind("quantity") %>' runat="Server"/></td>
              <td align="right" valign="top"><asp:Label runat="Server" ID="LabelPrice" Text='<%# Eval("price") %>'></asp:Label></td>
              <td align="right" valign="top"><asp:Label runat="Server" ID="LabelTotal" Text='<%# Eval("total") %>'></asp:Label></td>              
            </tr>
        </EditItemTemplate>
        <ItemTemplate>
            <tr class="even">
              <td align="center"> <asp:imagebutton AlternateText="Edit" ImageUrl="~/image/Edit.gif" ID="EditLinkButton" CommandName="Edit" Text="Edit" runat="server" />&nbsp;<asp:imagebutton AlternateText="Edit" ImageUrl="~/image/Delete.gif" ID="DeleteLinkButton" CommandName="Delete" Text="Delete" runat="server" /></td>
              <td align="center"><asp:HyperLink   NavigateUrl='~//product.aspx?id=<%# Eval("Product_id") %>' runat="Server" ><asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("image") %>' Width="40px" Height="40px" AlternateText='<%# Eval("product_name") %>' /></asp:HyperLink></td>
              <td align="left" valign="top"><a href=""><%# Eval("product_name") %></a></td>
              <td align="right" valign="top"><%# Eval("quantity") %></td>
              <td align="right" valign="top"><%# Eval("price") %></td>
              <td align="right" valign="top"><%# Eval( "total") %></td>
             
            </tr>
        </ItemTemplate> 
        <FooterTemplate>
            <tr class="even">
                <div style="width: 100%; display: inline-block;">
                    <table style="float: right; display: inline-block;">
                        <tr>
                            <td align="right">
                                <b>Thành tiền:</b></td>
                            <td align="right"><%=cartBus.carts.subtotal() %></asp:Label></td>
                        </tr>
                    </table>
                    <br />
                </div>                
                <td align="center">
                </td>
                <td align="center">
                </td>
            </tr>
        </FooterTemplate>
    </asp:datalist>
    <div>
        <span style="text-align:left;"><asp:Button ID="continue" runat="Server" CssClass="button" 
                        Text="Tiếp tục mua hàng" onclick="continue_Click" /></span>
                
         <span style="text-align:right;"><asp:Button ID="checkout" runat="Server" CssClass="button" 
                        Text="Thanh Toán" onclick="continue_checkout" /></span>
                
    </div> 
</div>

<div class="bottom">&nbsp;</div>